unit SmallStruct.Model;

interface

uses DB,
  SmallStruct.Core,
  SmallStruct.Database,
  SmallStruct.Tools;

const
  SS_MODEL_FACTORY_NAME: string = 'MODEL_FACTORY';

type
  ISSModelContext = interface(ISSObjectContext)
    ['{CD92B833-F0AC-4DC7-9C81-28D044E5376E}']
  end;

  ISSModel = interface(ISSRuntimeObject)
    ['{2FB97940-9167-4A47-96FB-7C8F84B6563F}']
  end;

  ISSDataModelContext = interface(ISSModelContext)
    ['{AE4547B0-582E-4027-A5FD-38F909491F85}']
    function GetDatabaseConnection: ISSDatabaseDriver;
  end;

  ISSDataModel = interface(ISSModel)
    ['{9C54B05D-DBF2-4B16-B23E-A1862AE68F9E}']
    function GetDataSet: ISSDataSet;
    function GetDataSource: TDataSource;
    function IsAutoOpen: Boolean;
    function IsReadOnly: Boolean;
    procedure AppendRecord;
    procedure ApplyModify;
    procedure CancelModify;
    procedure CloseDataModel;
    procedure DeleteRecord;
    procedure OpenDataModel(const OpenCondition: string);
    procedure RefreshDataModel;
  end;

  ISSModelFactory = interface(ISSObject)
    ['{441F0635-92E3-4AB6-A8E7-D3019B23065D}']
    function GetModel(const AModelName: string): ISSModel;
    procedure FreeModel(AModel: ISSModel);
  end;

  ISSDynamicModel = interface(ISSModel)
    ['{29C0B6DA-20A8-47AF-91A3-5D630D3638C7}']
    function GetData: ISSRecord;
  end;

implementation

end.
